/*
 * @Descripttion:
 * @Author: voanit
 * @Date: 2022-05-15 14:33:11
 * @LastEditors: voanit
 * @LastEditTime: 2022-05-19 14:57:23
 */
import { legacy_createStore as createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import { composeWithDevTools } from 'redux-devtools-extension'
import rootReducers from './reducers'

let middleware
if(process.env.NODE_ENV==='production'){
  /* 生产环境 */
  middleware=applyMiddleware(thunk)
}else{
  middleware=composeWithDevTools(applyMiddleware(thunk))
}
const store = createStore(
  rootReducers,
  middleware
)
export default store
